﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Blizzard.Contracts;
using Blizzard.Interceptors;

namespace Blizzard.Test.DataObjects
{
    [Mapper(Table = "d")]
    public class D : IDataObject
    {
        private Interceptor _interceptor;
        [Mapper(Field = "ID", IsIdentityColumn = true)]
        public int Id { get; set; }

        private string _name;
        [Mapper(Field = "Name")]
        public string Name
        {
            get
            {
                _interceptor.Intercept(this, "Name", false);
                return _name;
            }
            set
            {
                _interceptor.Intercept(this, "Name", true, _name, value);
                _name = value;
            }
        }


        


        private CC _ccc;

        [Mapper(Field = "CCId", Composition = false)]
        public CC ccc
        {
            get 
            {
                _interceptor.Intercept(this, "ccc", false);
                return _ccc; 
            }
            set 
            { 
                 _interceptor.Intercept(this, "ccc", true, _ccc , value);
                _ccc = value; 
            }
        }




       public Container.BlizzardManager Manager
       {
           set { _interceptor = new Interceptor(value); }
       }
    }
}
